<?php
class editAction extends rareAction{
    public function execute(){
		$id = $this->getGetParam('id',0);
		if($id!=0){
			$dao = new DaoVideo();
			$video = $dao->getOne("id='$id'");
			$this->assign('video',$video);
		}
	}
	public function executePost(){
		$id = $this->getPostParam('id',0);
		if($id==0) jsonReturn(0,'错误的参数');
		$video = $this->getPostParam('video',array());
		if(!empty($video)){
			$dao = new DaoVideo();
			$dao->update("id='$id'",$video);
			jsonReturn(1,'ok');
		}
		jsonReturn(0,'错误的参数');
	}
}
?>
